# -*- coding: utf-8 -*-
# @Time    : 2019-08-09 21:35
# @Author  : kbsonlong
# @Email   : kbsonlong@gmail.com
# @Blog    : www.alongparty.cn
# @File    : blog.py
# @Software: PyCharm

from rest_framework import serializers

from blog import models

class CategroySerializer(serializers.ModelSerializer):
    class Meta:
        model = models.Category
        fields = ['id','name','parent']


class TagSerializer(serializers.ModelSerializer):
    class Meta:
        model = models.Tag
        fields = '__all__'

class ArticleSerializer(serializers.ModelSerializer):
    # categroy = CategroySerializer(many=False, required=False)

    class Meta:
        model = models.Article
        # fields = ['id', 'title', 'author', 'body','thumbnail','categroy','tags']
        fields = '__all__'



class ActivateSerializer(serializers.ModelSerializer):
    class Meta:
        model = models.Activate
        fields = '__all__'

class CarouselSerializer(serializers.ModelSerializer):
    class Meta:
        model = models.Carousel
        fields = '__all__'